package com.atguigu.yygh.order.service;

import com.atguigu.yygh.model.order.OrderInfo;
import com.atguigu.yygh.model.order.PaymentInfo;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.Map;

/**
 * @author zr
 * @date 2021/12/22 20:26
 */
public interface PaymentService extends IService<PaymentInfo> {
    /**
     * 添加支付记录
     *
     * @param order
     * @param status
     */
    void savePaymentInfo(OrderInfo order, Integer status);

    /**
     * 根据订单编号更新订单状态
     *
     * @param outTradeNo
     * @param resultMap
     */
    void paySuccess(String outTradeNo, Map<String, String> resultMap);

    /**
     * 根据订单id 和支付类型获取支付记录
     *
     * @param orderId
     * @param paymentType
     * @return
     */
    PaymentInfo getPaymentInfo(Long orderId, Integer paymentType);

}
